package com.gxuwz.mapper;

import com.gxuwz.model.entity.Instructor;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface InstructorMapper {
    /*查询辅导员信息*/
    @Select("select * from sys_instructor where instId=#{instId}")
    Instructor selectInstByInstId(String instID);
    @Select("select * from sys_instructor where instName=#{instName}")
    Instructor selectInstByInstName(String instName);

    /*修改辅导员信息*/
    @Update("UPDATE sys_instructor SET instName = #{instName}, depID = #{depID}, telephone = #{telephone} , password = #{password} WHERE instID = #{instID}")
    int updateInstructor(Instructor instructor);

    /*添加辅导员*/
    @Insert("INSERT INTO sys_instructor (instName, depID, telephone, password) VALUES ( #{instName}, #{depID}, #{telephone}, #{password})")
    int insertInstructor(Instructor instructor);

    /*删除辅导员*/
    @Delete("DELETE FROM sys_instructor WHERE instID = #{instID}")
    int deleteInstructorByInstId(String instID);

    /*查询所有辅导员信息*/
    @Select("select * from sys_instructor")
    List<Instructor> getAllInstructor();

}

